<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>libcoap: coap_opt_iterator_t Struct Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">libcoap<span id="projectnumber">&#160;4.2.0</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.8 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function(){initNavTree('structcoap__opt__iterator__t.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>

<div class="header">
  <div class="summary">
<a href="#pub-attribs">Data Fields</a>  </div>
  <div class="headertitle"><div class="title">coap_opt_iterator_t Struct Reference<div class="ingroups"><a class="el" href="group__opt__filter.html">Option Filters</a></div></div></div>
</div><!--header-->
<div class="contents">

<p>Iterator to run through PDU options.  
 <a href="structcoap__opt__iterator__t.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="option_8h_source.html">option.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-attribs" name="pub-attribs"></a>
Data Fields</h2></td></tr>
<tr class="memitem:a4f8dcbdb5373cb073b95f8c91a72cb0c" id="r_a4f8dcbdb5373cb073b95f8c91a72cb0c"><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structcoap__opt__iterator__t.html#a4f8dcbdb5373cb073b95f8c91a72cb0c">length</a></td></tr>
<tr class="memdesc:a4f8dcbdb5373cb073b95f8c91a72cb0c"><td class="mdescLeft">&#160;</td><td class="mdescRight">remaining length of PDU  <br /></td></tr>
<tr class="separator:a4f8dcbdb5373cb073b95f8c91a72cb0c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0df30f4a2bb85deb3d493fded6967b9d" id="r_a0df30f4a2bb85deb3d493fded6967b9d"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structcoap__opt__iterator__t.html#a4f8dcbdb5373cb073b95f8c91a72cb0c">uint16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structcoap__opt__iterator__t.html#a0df30f4a2bb85deb3d493fded6967b9d">type</a></td></tr>
<tr class="memdesc:a0df30f4a2bb85deb3d493fded6967b9d"><td class="mdescLeft">&#160;</td><td class="mdescRight">decoded option type  <br /></td></tr>
<tr class="separator:a0df30f4a2bb85deb3d493fded6967b9d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a48cbd8005c37ff481fe7d10cfc1f4bb6" id="r_a48cbd8005c37ff481fe7d10cfc1f4bb6"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structcoap__opt__iterator__t.html#a4f8dcbdb5373cb073b95f8c91a72cb0c">unsigned</a> <a class="el" href="structcoap__opt__iterator__t.html#a4f8dcbdb5373cb073b95f8c91a72cb0c">int</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structcoap__opt__iterator__t.html#a48cbd8005c37ff481fe7d10cfc1f4bb6">bad</a>:1</td></tr>
<tr class="memdesc:a48cbd8005c37ff481fe7d10cfc1f4bb6"><td class="mdescLeft">&#160;</td><td class="mdescRight">iterator object is ok if not set  <br /></td></tr>
<tr class="separator:a48cbd8005c37ff481fe7d10cfc1f4bb6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6fed563dd49b61f28a275cd2f8c6f6a8" id="r_a6fed563dd49b61f28a275cd2f8c6f6a8"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structcoap__opt__iterator__t.html#a4f8dcbdb5373cb073b95f8c91a72cb0c">unsigned</a> <a class="el" href="structcoap__opt__iterator__t.html#a4f8dcbdb5373cb073b95f8c91a72cb0c">int</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structcoap__opt__iterator__t.html#a6fed563dd49b61f28a275cd2f8c6f6a8">filtered</a>:1</td></tr>
<tr class="memdesc:a6fed563dd49b61f28a275cd2f8c6f6a8"><td class="mdescLeft">&#160;</td><td class="mdescRight">denotes whether or not filter is used  <br /></td></tr>
<tr class="separator:a6fed563dd49b61f28a275cd2f8c6f6a8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a05da7c127d28e7ba39d7186169596f6a" id="r_a05da7c127d28e7ba39d7186169596f6a"><td class="memItemLeft" align="right" valign="top"><a class="el" href="option_8h.html#a963ad4994625360a5ac70d9df2ab5412">coap_opt_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structcoap__opt__iterator__t.html#a05da7c127d28e7ba39d7186169596f6a">next_option</a></td></tr>
<tr class="memdesc:a05da7c127d28e7ba39d7186169596f6a"><td class="mdescLeft">&#160;</td><td class="mdescRight">pointer to the unparsed next option  <br /></td></tr>
<tr class="separator:a05da7c127d28e7ba39d7186169596f6a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a40a864c48b367abcaed1afa30621f405" id="r_a40a864c48b367abcaed1afa30621f405"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__opt__filter.html#ga001c5b06ae9e02996509516871cb69a8">coap_opt_filter_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structcoap__opt__iterator__t.html#a40a864c48b367abcaed1afa30621f405">filter</a></td></tr>
<tr class="memdesc:a40a864c48b367abcaed1afa30621f405"><td class="mdescLeft">&#160;</td><td class="mdescRight">option filter  <br /></td></tr>
<tr class="separator:a40a864c48b367abcaed1afa30621f405"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Iterator to run through PDU options. </p>
<p>This object must be initialized with <a class="el" href="group__opt__filter.html#gaa76930050882387b0f5c7d0246e14440" title="Initializes the given option iterator oi to point to the beginning of the pdu&#39;s option list.">coap_option_iterator_init()</a>. Call <a class="el" href="group__opt__filter.html#ga19d4dbbc03ef362996964fbfdd1d4c7b" title="Updates the iterator oi to point to the next option.">coap_option_next()</a> to walk through the list of options until <a class="el" href="group__opt__filter.html#ga19d4dbbc03ef362996964fbfdd1d4c7b" title="Updates the iterator oi to point to the next option.">coap_option_next()</a> returns <code>NULL</code>.</p>
<div class="fragment"><div class="line"><a class="code hl_typedef" href="option_8h.html#a963ad4994625360a5ac70d9df2ab5412">coap_opt_t</a> *<a class="code hl_variable" href="structcoap__opt__iterator__t.html#a4f8dcbdb5373cb073b95f8c91a72cb0c">option</a>;</div>
<div class="line"><a class="code hl_struct" href="structcoap__opt__iterator__t.html">coap_opt_iterator_t</a> <a class="code hl_variable" href="structcoap__opt__iterator__t.html#a4f8dcbdb5373cb073b95f8c91a72cb0c">opt_iter</a>;</div>
<div class="line"><a class="code hl_function" href="group__opt__filter.html#gaa76930050882387b0f5c7d0246e14440">coap_option_iterator_init</a>(pdu, &amp;<a class="code hl_variable" href="structcoap__opt__iterator__t.html#a4f8dcbdb5373cb073b95f8c91a72cb0c">opt_iter</a>, <a class="code hl_define" href="group__opt__filter.html#ga81f470e9cdcc258799e10f6ed8a3ce5e">COAP_OPT_ALL</a>);</div>
<div class="line"> </div>
<div class="line"><span class="keywordflow">while</span> ((<a class="code hl_variable" href="structcoap__opt__iterator__t.html#a4f8dcbdb5373cb073b95f8c91a72cb0c">option</a> = <a class="code hl_function" href="group__opt__filter.html#ga19d4dbbc03ef362996964fbfdd1d4c7b">coap_option_next</a>(&amp;<a class="code hl_variable" href="structcoap__opt__iterator__t.html#a4f8dcbdb5373cb073b95f8c91a72cb0c">opt_iter</a>))) {</div>
<div class="line">  ... <span class="keywordflow">do</span> <a class="code hl_variable" href="structcoap__opt__iterator__t.html#a4f8dcbdb5373cb073b95f8c91a72cb0c">something</a> <a class="code hl_variable" href="structcoap__opt__iterator__t.html#a4f8dcbdb5373cb073b95f8c91a72cb0c">with</a> <a class="code hl_variable" href="structcoap__opt__iterator__t.html#a4f8dcbdb5373cb073b95f8c91a72cb0c">option</a> ...</div>
<div class="line">}</div>
<div class="ttc" id="agroup__opt__filter_html_ga19d4dbbc03ef362996964fbfdd1d4c7b"><div class="ttname"><a href="group__opt__filter.html#ga19d4dbbc03ef362996964fbfdd1d4c7b">coap_option_next</a></div><div class="ttdeci">coap_opt_t * coap_option_next(coap_opt_iterator_t *oi)</div><div class="ttdoc">Updates the iterator oi to point to the next option.</div><div class="ttdef"><b>Definition</b> <a href="option_8c_source.html#l00157">option.c:157</a></div></div>
<div class="ttc" id="agroup__opt__filter_html_ga81f470e9cdcc258799e10f6ed8a3ce5e"><div class="ttname"><a href="group__opt__filter.html#ga81f470e9cdcc258799e10f6ed8a3ce5e">COAP_OPT_ALL</a></div><div class="ttdeci">#define COAP_OPT_ALL</div><div class="ttdoc">Pre-defined filter that includes all options.</div><div class="ttdef"><b>Definition</b> <a href="option_8h_source.html#l00122">option.h:122</a></div></div>
<div class="ttc" id="agroup__opt__filter_html_gaa76930050882387b0f5c7d0246e14440"><div class="ttname"><a href="group__opt__filter.html#gaa76930050882387b0f5c7d0246e14440">coap_option_iterator_init</a></div><div class="ttdeci">coap_opt_iterator_t * coap_option_iterator_init(const coap_pdu_t *pdu, coap_opt_iterator_t *oi, const coap_opt_filter_t filter)</div><div class="ttdoc">Initializes the given option iterator oi to point to the beginning of the pdu's option list.</div><div class="ttdef"><b>Definition</b> <a href="option_8c_source.html#l00121">option.c:121</a></div></div>
<div class="ttc" id="aoption_8h_html_a963ad4994625360a5ac70d9df2ab5412"><div class="ttname"><a href="option_8h.html#a963ad4994625360a5ac70d9df2ab5412">coap_opt_t</a></div><div class="ttdeci">uint8_t coap_opt_t</div><div class="ttdoc">Use byte-oriented access methods here because sliding a complex struct coap_opt_t over the data buffe...</div><div class="ttdef"><b>Definition</b> <a href="option_8h_source.html#l00025">option.h:25</a></div></div>
<div class="ttc" id="astructcoap__opt__iterator__t_html"><div class="ttname"><a href="structcoap__opt__iterator__t.html">coap_opt_iterator_t</a></div><div class="ttdoc">Iterator to run through PDU options.</div><div class="ttdef"><b>Definition</b> <a href="option_8h_source.html#l00237">option.h:237</a></div></div>
<div class="ttc" id="astructcoap__opt__iterator__t_html_a4f8dcbdb5373cb073b95f8c91a72cb0c"><div class="ttname"><a href="structcoap__opt__iterator__t.html#a4f8dcbdb5373cb073b95f8c91a72cb0c">coap_opt_iterator_t::length</a></div><div class="ttdeci">size_t length</div><div class="ttdoc">remaining length of PDU</div><div class="ttdef"><b>Definition</b> <a href="option_8h_source.html#l00238">option.h:238</a></div></div>
</div><!-- fragment --> 
<p class="definition">Definition at line <a class="el" href="option_8h_source.html#l00237">237</a> of file <a class="el" href="option_8h_source.html">option.h</a>.</p>
</div><h2 class="groupheader">Field Documentation</h2>
<a id="a48cbd8005c37ff481fe7d10cfc1f4bb6" name="a48cbd8005c37ff481fe7d10cfc1f4bb6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a48cbd8005c37ff481fe7d10cfc1f4bb6">&#9670;&#160;</a></span>bad</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structcoap__opt__iterator__t.html#a4f8dcbdb5373cb073b95f8c91a72cb0c">unsigned</a> <a class="el" href="structcoap__opt__iterator__t.html#a4f8dcbdb5373cb073b95f8c91a72cb0c">int</a> coap_opt_iterator_t::bad</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>iterator object is ok if not set </p>

<p class="definition">Definition at line <a class="el" href="option_8h_source.html#l00240">240</a> of file <a class="el" href="option_8h_source.html">option.h</a>.</p>

</div>
</div>
<a id="a40a864c48b367abcaed1afa30621f405" name="a40a864c48b367abcaed1afa30621f405"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a40a864c48b367abcaed1afa30621f405">&#9670;&#160;</a></span>filter</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__opt__filter.html#ga001c5b06ae9e02996509516871cb69a8">coap_opt_filter_t</a> coap_opt_iterator_t::filter</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>option filter </p>

<p class="definition">Definition at line <a class="el" href="option_8h_source.html#l00243">243</a> of file <a class="el" href="option_8h_source.html">option.h</a>.</p>

</div>
</div>
<a id="a6fed563dd49b61f28a275cd2f8c6f6a8" name="a6fed563dd49b61f28a275cd2f8c6f6a8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6fed563dd49b61f28a275cd2f8c6f6a8">&#9670;&#160;</a></span>filtered</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structcoap__opt__iterator__t.html#a4f8dcbdb5373cb073b95f8c91a72cb0c">unsigned</a> <a class="el" href="structcoap__opt__iterator__t.html#a4f8dcbdb5373cb073b95f8c91a72cb0c">int</a> coap_opt_iterator_t::filtered</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>denotes whether or not filter is used </p>

<p class="definition">Definition at line <a class="el" href="option_8h_source.html#l00241">241</a> of file <a class="el" href="option_8h_source.html">option.h</a>.</p>

</div>
</div>
<a id="a4f8dcbdb5373cb073b95f8c91a72cb0c" name="a4f8dcbdb5373cb073b95f8c91a72cb0c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4f8dcbdb5373cb073b95f8c91a72cb0c">&#9670;&#160;</a></span>length</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">size_t coap_opt_iterator_t::length</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>remaining length of PDU </p>

<p class="definition">Definition at line <a class="el" href="option_8h_source.html#l00238">238</a> of file <a class="el" href="option_8h_source.html">option.h</a>.</p>

</div>
</div>
<a id="a05da7c127d28e7ba39d7186169596f6a" name="a05da7c127d28e7ba39d7186169596f6a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a05da7c127d28e7ba39d7186169596f6a">&#9670;&#160;</a></span>next_option</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="option_8h.html#a963ad4994625360a5ac70d9df2ab5412">coap_opt_t</a>* coap_opt_iterator_t::next_option</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>pointer to the unparsed next option </p>

<p class="definition">Definition at line <a class="el" href="option_8h_source.html#l00242">242</a> of file <a class="el" href="option_8h_source.html">option.h</a>.</p>

</div>
</div>
<a id="a0df30f4a2bb85deb3d493fded6967b9d" name="a0df30f4a2bb85deb3d493fded6967b9d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0df30f4a2bb85deb3d493fded6967b9d">&#9670;&#160;</a></span>type</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structcoap__opt__iterator__t.html#a4f8dcbdb5373cb073b95f8c91a72cb0c">uint16_t</a> coap_opt_iterator_t::type</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>decoded option type </p>

<p class="definition">Definition at line <a class="el" href="option_8h_source.html#l00239">239</a> of file <a class="el" href="option_8h_source.html">option.h</a>.</p>

</div>
</div>
<hr/>The documentation for this struct was generated from the following file:<ul>
<li><a class="el" href="option_8h_source.html">option.h</a></li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="structcoap__opt__iterator__t.html">coap_opt_iterator_t</a></li>
    <li class="footer">Generated on Fri Dec 27 2024 09:57:44 for libcoap by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.8 </li>
  </ul>
</div>
</body>
</html>
